/**
 * In me the tiger sniffs the rose.
 *
 * @Author:徐家政
 * @Date:2019-04-19 22:36
 */
package com.shiyu.demo.service.impl;

import com.shiyu.demo.entity.About;
import com.shiyu.demo.entity.CommunityPost;
import com.shiyu.demo.mapper.WritePostMapper;
import com.shiyu.demo.service.WritePostService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WritePostServiceImpl implements WritePostService {
    @Resource
    private WritePostMapper writePostMapper;
    @Override
    public String getUserImg(Integer userid) {
        return writePostMapper.getUserImg(userid);
    }

    @Override
    public List<About> getAbout() {
        return writePostMapper.getAbout();
    }

    @Override
    public Integer addPost(Integer userid, String posttext, String postname, Integer aboutid) {
        CommunityPost communityPost=new CommunityPost();
        communityPost.setUserid(userid);
        communityPost.setPosttext(posttext);
        communityPost.setPostname(postname);
        communityPost.setAboutid(aboutid);
        return writePostMapper.addPost(communityPost);
    }


}
